package com.cfpl.security;

import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 异常处理器
 */
@RestControllerAdvice
@Slf4j
public class AccessDeniedExceptionHandler {

    //处理权限不足异常，捕获到异常后再次抛出，交给MyAccessDeniedHandler处理
    @ExceptionHandler(AccessDeniedException.class)
    public void defaultExceptionHandler(AccessDeniedException e){
        log.info("*******处理权限不足异常**********");
        throw e;
    }



}
